package org.huifei.a8_dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author: huifei
 * @date: 2017-08-30 15:24
 */
public class DynamicSubject implements InvocationHandler{

    private Object object;

    public DynamicSubject(Object object) {
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("before : " + method);
        method.invoke(object, args);
        System.out.println("after : " + method);
        return null;
    }
}
